package tpo.lmhprovider.lmhprovider.controller;

import api.wares.BrandApi;
import dto.Dto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;
import pojo.Brand;
import tpo.lmhprovider.lmhprovider.service.BrandService;

import java.util.List;
import java.util.Map;

@RestController
public class BrandController implements BrandApi {
    @Autowired
    BrandService brandService;

    @Override
    public Dto<List<Brand>> getBrand(Map map) {
        Dto dto=new Dto();
        dto.setObj(brandService.getBrand(map));
        return dto;
    }

    @Override
    public Dto<Integer> delBrand(Map map) {
        Dto dto=new Dto();
        dto.setObj(brandService.delBrand(map));
        return dto;
    }

    @Override
    public Dto<Integer> addBrand(Map map) {
        Dto dto=new Dto();
        dto.setObj(brandService.addBrand(map));
        return dto;
    }

    @Override
    public Dto<Integer> updateBrand(Map map) {
        Dto dto=new Dto();
        dto.setObj(brandService.updateBrand(map));
        return dto;
    }
}
